<?php

namespace App\Listeners;

use App\Func\System\OperateLogFunc;
use Illuminate\Queue\Events\JobProcessing;

class QueueJobProcessingListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  \Illuminate\Queue\Events\JobProcessing  $event
     * @return void
     */
    public function handle(JobProcessing $event)
    {
        // 获取队列任务的数据
        $payload = $event->job->payload();


        // 添加操作记录
        OperateLogFunc::addOperate(
            'testxxxx',1,$event->job->getQueue(),$payload
        );
    }
}
